// 入口文件
import React from 'react';
import ReactDOM from 'react-dom'
import { Navigator,NoMatch,Home,ProductDetails,Product,Mime,Carts} from './components'
import Counter from './container/Counter'
import style from './main.scss';
import { HashRouter as Router, Route,Switch} from 'react-router-dom'

import {Provider } from 'react-redux'
import store from './store'

class Index extends React.Component{
    render(){
        return (
            <Router>
               <div>
                <Navigator/>
                <Switch>
                    <Route path="/" component={Home} exact/>
                    <Route path="/mime" component={Mime}/>
                    <Route path="/counter" component={Counter}/>
                    <Route path="/product/:id" component={ProductDetails}/>
                    <Route path="/product" component={Product}/>
                    <Route path="/carts" component={Carts}/>
                    <Route component={NoMatch}/>
                </Switch>  
                </div> 
            </Router>
        )
    }
}

ReactDOM.render(
       <Provider store={store}>
           <Index/>
       </Provider>
,document.getElementById('app'));